home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / rjs.lha / RJS / CmdLine / src / CmdOpt_int.C < prev    next >
C/C++ Source or Header  |  1991-06-14  |  643b  |  39 lines

  1. #include "CmdLine.h"
  2.  
  3. #include <RJS/Convert.h>
  4.  
  5. RJS_CmdOpt_int::RJS_CmdOpt_int(const char *k, RJS_CmdOpt::CmdOptFlags f) 
  6.     : RJS_CmdOpt(k,f|Value) 
  7.     val=0; 
  8. }
  9.  
  10. RJS_CmdOpt_int::RJS_CmdOpt_int(const char *k, const RJS_String &dv, RJS_CmdOpt::CmdOptFlags f)
  11.     : RJS_CmdOpt(k,dv,f)
  12.     val=0;
  13. }
  14.  
  15. int RJS_CmdOpt_int::set_value() 
  16. {
  17.     val=RJS_Convert::toInt(RJS_CmdOpt::val);
  18.     if (RJS_Convert::ok()) return 1; else return 0;
  19. }
  20.  
  21. const char *RJS_CmdOpt_int::value_type()
  22. {
  23.     return "integer";
  24. }
  25.  
  26. void RJS_CmdOpt_int::reset() 
  27. {
  28.     val=0;
  29.     RJS_CmdOpt::reset();
  30. }
  31.  
  32. void RJS_CmdOpt_int::dump()
  33. {
  34.     RJS_CmdOpt::dump();
  35.     cout << "int: " << value() << endl;
  36. }
  37.